package com.czz.portal.controller;

import com.czz.common.vo.R;
import com.czz.portal.entity.Ad;
import com.czz.portal.service.AdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: AdController
 * @Author Czz
 * @Date 2020/2/6
 * @Time 13:06
 **/
@RestController
@RequestMapping(value = "/ad")
public class AdController {

    @Autowired
    AdService adService;

    /**
    * @Description 获取首页轮播图
    * @Param []
    * @Return com.czz.common.vo.R
    * @Author Czz
    * @Date 2020/2/6
    * @Time 13:30
    **/
    @GetMapping(value = "")
    public R getAdList(){
        List<Ad> adList = adService.getAdList();
        return R.ok().data("items",adList);
    }
}
